package com.example.szh.nextwork.model;

import com.google.gson.Gson;

import java.util.Map;

import okhttp3.MediaType;
import okhttp3.RequestBody;

public class BaseModel implements IModel {
    @Override
    public RequestBody createBody(Map<String, Object> map) {
        //map转化字符串
        if (map==null)
            return null;
        String json = new Gson().toJson(map);
        RequestBody body=RequestBody.create(MediaType.parse("application/json"),json);
        return body;
    }
}
